"use strict"
//万能表单
const dbase = require('../dbase');

class formsNavbar extends dbase.branch.mongodb {
    constructor(branch){
        super(branch,'formsNavbar');
        this.ObjectID = ObjectID.bind(this);
    }
}

class formsFields extends dbase.branch.mongodb {
    constructor(branch){
        super(branch,'formsFields');
        this.ObjectID = ObjectID.bind(this);
    }
}

module.exports.navbar = function(branch){
    return new formsNavbar(branch);
}

module.exports.fields = function(branch){
    return new formsFields(branch);
}

function ObjectID(id){
    if(id){
        return id;
    }
    else{
        return parseInt(Date.now() / 1000).toString(32);
    }
}